{extend name="user_base" /} {block name="seo"}
<title>修改个人信息 - {$site_config['seo_title']}</title>
<meta name="keywords" content="{$site_config['seo_keyword']}">
<meta name="description" content="{$site_config['seo_description']}">
{/block}
{block name="css"}

{/block}
{block name="main"}
<div class="title" style="margin-bottom:20px;"> 修改资料</div>
<form class="layui-form atuikeFormSkin1" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline" style="margin-right: 40px; width: 215.5px;">
            <input type="text"  name="username" class="layui-input" placeholder="用户名" value="{$user.username}">
        </div>
        <div class="layui-form-mid layui-word-aux">用户名一个月只能修改一次</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">昵称</label>
        <div class="layui-input-inline" style="margin-right: 40px; width: 215.5px;">
            <input type="text" name="nick" class="layui-input" placeholder="昵称" value="{$user.nickname}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">我的简介</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea" name="description" placeholder="签名">{$user.description}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="sex"  value="0" title="男" {if $user.sex eq 0} checked {/if}/>
            <input type="radio" name="sex" value="1" title="女" {if $user.sex eq 1} checked {/if} >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">我的QQ</label>
        <div class="layui-input-inline" style="margin-right: 40px; width: 215.5px;">
            <input type="text" class="layui-input" placeholder="QQ" maxlength="10" name="qq_id" value="{$user.qq_id}">
        </div>
        <div class="layui-form-mid layui-word-aux">投稿后用户联系您的方式，个人主页也会显示</div>
    </div>

    <div class="inline-form layui-clear">
        <div class="layui-form-item">
            <label class="layui-form-label">个性推广
                <i class="iconfont icon-wenhao" style="position:relative;margin-left:5px;top:2px;" data-title="此处个性推广用于展示在个人主页，设置后 用户查看到您主页时， 会在右边显示此自定义按钮，用户点击后可跳转到您想跳转的页面， 一般用于推广自己的网站或加线报群使用。"></i></label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="promotion_site" placeholder="{$site_config.site_title}" maxlength="10" value="{$user.promotion_site}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">跳转的地址</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="promotion_url" placeholder="跳转链接" value="{$user.promotion_url}">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn atuikeBtnSkin1" lay-submit lay-filter="formDemo">保存信息</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        var form = layui.form;
        var layer = layui.layer;
        //监听提交
        form.on('submit(formDemo)', function (data) {
            request({
                data:data.field,
                success:function (data) {
                    data.msg&&layer.msg(data.msg);
                    // data.msg&&layer.open({
                    //     type: 0,
                    //     shadeClose: true,
                    //     skin: 'atuikeLayerSkin1',
                    //     content: data.msg
                    // });
                }
            });


            return false;
        });

        $(".icon-wenhao").hover(function (e) {
            layer.tips($(this).attr("data-title"), $(this), {
                tips: [2, '#000'],
                area: ['300px'],
                time: 0
            });
        }, function () {
            layer.closeAll();
        });
    });
</script>
{/block}